package tw.com.softleader.spring.app;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import tw.com.softleader.spring.service.BookService;

public class SpringApp {
	
	private static Logger log = LoggerFactory.getLogger(SpringApp.class);
	
	public static void main(String[] args) {
		
		ApplicationContext applicationContext 
			= new ClassPathXmlApplicationContext( 
					new String[] {"spring-service.xml"}
				);
		
		BookService bookService
			= (BookService) applicationContext.getBean("bookService");
		bookService.getAll();
		
//		SpringService ss 
//			= (SpringService)applicationContext.getBean("springService");
//		
//		log.debug(ss.getHello("Gary"));
//		
//		log.debug("{}", ss.getAllFruits());
		
	}
}
